package util;

import java.util.ArrayList;
import java.util.Calendar;

public class MyCalendar {
	
	private ArrayList<Integer> myCalendar;
		
	public MyCalendar(int year, int month) {
		Calendar sDay = Calendar.getInstance();
		Calendar eDay = Calendar.getInstance();
			
		sDay.set(year, month-1, 1);
		eDay.set(year, month-1, sDay.getActualMaximum(Calendar.DATE));
		
		sDay.add(Calendar.DATE, -sDay.get(Calendar.DAY_OF_WEEK)+1);
		eDay.add(Calendar.DATE, 7-eDay.get(Calendar.DAY_OF_WEEK));
		
		ArrayList<Integer> datelist = new ArrayList<Integer>();
		for( sDay.get(Calendar.DATE); sDay.before(eDay) || sDay.equals(eDay); sDay.add(Calendar.DATE, 1)){
			datelist.add( sDay.get(Calendar.DATE));			
		}
		myCalendar = datelist;
	}

	public ArrayList<Integer> getMyCalendar() {
		return myCalendar;
	}

	public void setMyCalendar(ArrayList<Integer> myCalendar) {
		this.myCalendar = myCalendar;
	}	
		
}
